package com.cyx.gametool.builder;

import cn.hutool.core.thread.ThreadUtil;
import com.cyx.gametool.excel.ExcelColumnTitle;

import java.io.File;
import java.util.ArrayList;
import java.util.List;
import java.util.concurrent.ExecutorService;

public abstract class AbsBuilder<T extends AbsBuilder<T>> implements IBuilder {

    /**
     * 原文件
     */
    protected File sourceFile;

    /**
     * excel标题信息数据
     */
    protected List<ExcelColumnTitle> excelColumnTitles;

    /**
     * excel数据
     */
    protected List<List<Object>> excelDataList;

    /**
     * sheet名称
     */
    protected String sheetName;

    public AbsBuilder() {
        excelColumnTitles = new ArrayList<>();
        excelDataList = new ArrayList<>();

        ExecutorService executorService = ThreadUtil.newFixedExecutor(10, "excel-builder-pool", true);
    }

    public abstract T setSourceFile(File sourceFile);

    public abstract T setExcelColumnTitles(List<ExcelColumnTitle> excelColumnTitles);

    public abstract T setExcelDataList(List<List<Object>> excelDataList);

    public abstract T setSheetName(String sheetName);
}
